% FUNCTION: haargrid(v)
% Input: A vector v representing a Haar wavelet or a  Haar scaling function.
% Output: A vector x with a grid suitable for using when plotting v.
% -------------------------------------------------------------------
% The input vector v can be any vector obtained as the output from a call to
% any of the functions "haarscale" or "haarwavelet". It will return an
% evenly spaced grid with values between [-1,2].
% EXAMPLE: v=haarwavelet(0,0);
%          x=haargrid(v);
%          plot(x,v)
% plots the mother Haar wavelet (normalized) on the interval [-1,2].
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5

function x=haargrid(v)

x = linspace(-1,2,length(v));